{config_load file='site.conf' section='site_index'}
{include file='header.tpl'}
{literal}
 <SCRIPT LANGUAGE="JavaScript">
 <!--
 	 $(document).ready(function()
	{
		$("#tb_list tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
		$("#tb_list tr:even").addClass("alt");
	}
	);
					   
	function doDelBlog(blogId)
	{
		if(confirm("本当にブログ["+blogId+"]を削除しますか"))
		{

			$("#actionType").attr("value","del");
			$("#blogId").attr("value",blogId);
			$("#myForm").submit();
		}
	}
	
	function doEditBlog(blogId)
	{
		$("#action").attr("value","view");
		$("#blogId").attr("value",blogId);
		$("#myForm").attr("method","post");
		$("#myForm").attr("action","site_edit.php");
		$("#myForm").submit();
	}
 //-->
 </SCRIPT>
{/literal}
<div id="bg">
	<div id="page">
		<div id="content">
		{if $msg ne ""}<div class="errorMsg">{$msg}</div>{/if}
			<div class="post">
            	<table width="100%" >
                <tr><td><h2 class="title">ブログ検索</h2></td>
                <td align="right" valign="bottom"><a href="site_new.php">ブログ登録</a></td></tr>
                </table>
				<div class="entry">
								
				<form id="myForm" action="{$SCRIPT_NAME}" method="get">
				<input type="hidden" name="actionType" id="actionType"/>
				<input type="hidden" name="blogId" id="blogId"/>
				
				<table width="500" id="tb_form">
               	  <tr>
                        <th >ブログタイトル：</th>
                        <td><input name="title" type="text" id="title" size="30" maxlength="30" value="{$formvars.title|escape}" /></td>
                    </tr>
                    <tr>
						<th >&nbsp</th>
                        <td><input type="submit" value="検索" class="submitButton"/></td>
                    </tr>
	        	</table>
					
				</form>
				</div>
			</div>	
			<div class="post">	
			<h2 class="title">ブログ一覧</h2>
				<div class="entry">
				{$paging}
                <table width="850" border="0" cellpadding="8" cellspacing="1" id="tb_list" >
                  <tr bgcolor="#CC0000">
                    <th>ブログID</th>
                    <th>タイトル</th>
                    <th>更新頻度</th>
                    <th>国別</th>
                    <th>ステータス</th>
                    <th>RSS</th>
                    <th>&nbsp;</th>
                  </tr>
				  
				  {foreach from=$blogList item=row}
    				<tr bgcolor="#FFFFFF">
	                	<td>{ $row.urllist_id }</td>
    					<td>{ $row.blog_title } <a href="{ $row.blog_url }" target="_blank">GO</a></td>
    					<td>{if $row.crawler_rank==1 }週に１回{elseif $row.crawler_rank==2}数日に１回{else}毎日{/if}</td>
    					<td>{ $row.country_name }</td>
						<td>{if $row.open_flag == 1}open{else}close{/if}</td>
    					<td>{if $row.rss_url != ""}○{else}×{/if}</td>
    					<td><a href="#" OnClick="doEditBlog({$row.urllist_id});">編集</a> <a href="#" OnClick="doDelBlog({$row.urllist_id});">削除</a></td>
                 	 </tr>
				  {/foreach}
                </table>
				{$paging}
			  </div>
			</div>
		</div>
		<!-- end #content -->
		<!-- end #sidebar -->
<div style="clear: both; height: 20px;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
{include file='footer.tpl'}



